//
//  XPNetworkTools.h
//  SinaWeibo
//
//  Created by 徐攀 on 16/5/13.
//  Copyright © 2016年 徐攀. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

typedef enum : NSUInteger {
    RequestTypeGET,
    RequestTypePOST,
} RequestType;

typedef void(^CompleteBlock)(id response, NSError *error);
typedef void(^FinishedBlock)(BOOL isSuccess);

@interface XPNetworkTools : AFHTTPSessionManager

+ (instancetype)sharedTool;

- (void)requestWithType:(RequestType)type URLString:(NSString *)URLString parameters:(id)parameters completeBlock:(CompleteBlock)completeBlock;
- (void)requestAccessToken:(NSString *)code finishedBlock:(FinishedBlock)finishedBlock;

@end
